<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Date</title>
</head>
<body>
<script>
    var myDate = new Date();

    console.log(myDate);
    console.log(myDate.getDate());
    console.log(myDate.getDay());
    console.log(myDate.getMonth());
    console.log(myDate.getFullYear());
    console.log(myDate.getHours());
    console.log(myDate.getMinutes());
    console.log(myDate.getSeconds());
    console.log(myDate.getMilliseconds());

    console.log(myDate.getTime()); // 获取时间戳。
</script>
</body>
</html>